<?php

namespace app\common\library;

class MemberVo
{
    private static $instance;

    protected $id;

    protected $member_type;

    protected $mini_openid;

    protected $shop_id;

    protected $token;

    public static function instance($options = []): self
    {
        if (is_null(self::$instance)) {
            self::$instance = new static($options);
        }
        return self::$instance;
    }

    public function getMemberType(): int
    {
        return $this->member_type;
    }

    public function setMemberType($member_type): void
    {
        $this->member_type = (int)$member_type;
    }

    public function getMemberId(): int
    {
        return $this->id ?? 0;
    }

    public function setMemberId($id): void
    {
        $this->id = (int)$id;
    }

    public function getMiniOpenId(): string
    {
        return $this->mini_openid ?? '';
    }

    public function setMiniOpenId($mini_openid): void
    {
        $this->mini_openid = $mini_openid;
    }

    public function getShopId(): int
    {
        return $this->shop_id ?? 0;
    }

    public function setShopId($shop_id): void
    {
        $this->shop_id = (int)$shop_id;
    }

    public function getToken()
    {
        return $this->token ?? '';
    }

    public function setToken($token): void
    {
        $this->token = $token;
    }


}